{% extends "ponsol2web/base_generic.html" %}
{% block title %} Predict {% endblock %}
{% block content %}
    <div class="page-header">
        <h1>Input FASTA sequence(s)</h1>
    </div>
    <div class="form row">
        {% if error_msg %}
            <div class="col-lg-12">
                <div class="alert alert-warning" role="alert">{{ error_msg }}</div>
            </div>
        {% endif %}
        <form id="ponsol_form" enctype="multipart/form-data" action="{% url "ponsol2:predict-seq" %}" method="post">
            {% csrf_token %}
            <div class="form-group col-md-12">
                <label for="seq">FASTA sequence(s)</label>
                <a id="example_input" href="javascript:set_example()">Example</a>
                <div class="fix-vertical-center">
                    <div style="padding-left: 0px" class="col-md-8">
                        <textarea class="form-control" rows="10" name="seq" id="seq"></textarea>
                    </div>
                    <div class="col-md-1">
                        <strong>
                            OR
                        </strong>
                    </div>
                    <div class="col-md-3" style="margin-top: auto; margin-bottom: auto;">
                        <label for="sequenceInputFile">Upload sequence file in FASTA format
                            <a class="btn btn-primary btn-xs text-capitalize" href="{% url "ponsol2:download-example-input-fasta-seq" %}">
                                <span class="glyphicon glyphicon-download-alt"></span>download example
                            </a>
                        </label>
                        <input type="file" id="sequenceInputFile" name="sequenceInputFile">
                    </div>
                </div>
            </div>

            <div class="form-group col-md-12">
                    <label class="right-align" for="aa">Amino acid substitution(s)</label>
                <div class="fix-vertical-center">
                    <div class="col-md-8" style="padding-left: 0px">
                        <textarea class="form-control" rows="10" type="text" name="aa" id="aa"></textarea>
                    </div>
                    <div class="col-md-1">
                        <strong>
                            OR
                        </strong>
                    </div>
                    <div class="col-md-3">
                        <label for="aasInputFile">Upload variation file
                            <a class="btn btn-primary btn-xs text-capitalize" href="{% url "ponsol2:download-example-input-fasta-aa" %}">
                                <span class="glyphicon glyphicon-download-alt"></span>download example
                            </a>
                        </label>
                        <input type="file" id="aasInputFile" name="assInputFile">
                    </div>
                </div>
            </div>
            <div class="form-group col-md-12">
                <div class="col-md-8" style="padding-left: 0px">
                    <label class="right-align" for="mail">E-mail</label>
                    <input type="email" name="mail" class="form-control" id="mail" placeholder="Email" required>
                </div>
            </div>
            <div class="col-md-8">
                <input class="btn btn-primary text-capitalize btn-block" type="submit" value="start predict">
            </div>
            {% if record_count %}
                <div class="text-right col-md-8" style="margin-top: 20px">Number of
                    calculations: {{ record_count }}</div>
            {% endif %}
        </form>
    </div>
    <script type="text/javascript">
        function set_example() {
            var seq_input = document.getElementById("seq")
            seq_input.value = ">AAK83653.1 11-beta hydroxysteroid dehydrogenase type 1 [Homo sapiens]\n\
MAFMKKYLLPILGLFMAYYYYSANEEFRPEMLQGKKVIVTGASKGIGREMAYHLAKMGAHVVVTARSKET\
LQKVVSHCLELGAASAHYIAGTMEDMTFAEQFVAQAGKLMGGLDMLILNHITNTSLNLFHDDIHHVRKSM\
EVNFLSYVVLTVAALPMLKQSNGSIVVVSSLAGKVAYPMVAAYSASKFALDGFFSSIRKEYSVSRVNVSI\
TLCVLGLIDTETAMKAVSGIVHMQAAPKEECALEIIKGGALRQEEVYYDSSLWTTLLIRNPCRKILEFLY\
STSYNMDRFINK\n\n\
>sp|Q8NH21|OR4F5_HUMAN Olfactory receptor 4F5 OS=Homo sapiens OX=9606 GN=OR4F5 PE=3 SV=1\n\
MVTEFIFLGLSDSQELQTFLFMLFFVFYGGIVFGNLLIVITVVSDSHLHSPMYFLLANLS\
LIDLSLSSVTAPKMITDFFSQRKVISFKGCLVQIFLLHFFGGSEMVILIAMGFDRYIAIC\
KPLHYTTIMCGNACVGIMAVTWGIGFLHSVSQLAFAVHLLFCGPNEVDSFYCDLPRVIKL\
ACTDTYRLDIMVIANSGVLTVCSFVLLIISYTIILMTIQHRPLDKSSKALSTLTAHITVV\
LLFFGPCVFIYAWPFPIKSLDKFLAVFYSVITPLLNPIIYTLRNKDMKTAIRQLRKWDAH\
SSVKF"
            var seq_aa = document.getElementById("aa")
            seq_aa.value = ">AAK83653.1 11-beta hydroxysteroid dehydrogenase type 1 [Homo sapiens]\n\
M1A\nF3K\n\
>sp|Q8NH21|OR4F5_HUMAN Olfactory receptor 4F5 OS=Homo sapiens OX=9606 GN=OR4F5 PE=3 SV=1\n\
V2E\nT3F\
            "
        }
    </script>
{% endblock %}